<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />
		<link href="css/AllStyle.css" rel="stylesheet" />
		<script src="js/jquery.min.js"></script>
		<script src="js/mui.min.js"></script>
		<script src="js/common.js"></script>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<h1 class="mui-title">报工列表</h1>
		</header>
		<ul class="mui-table-view" style="margin-top: 43px;" id="myList">
		</ul>
	</body>
	<script type="text/javascript">
		mui.init();
		mui.plusReady(function () {
			var sData = plus.webview.currentWebview();
			mui.ajax(getServerUrl()+'/task/findByProcId/'+sData.procId,{
				headers:{
					"X-Access-Token":getCookie("token")
				},
				type:'get',
				timeout:100000,
				success:function(data){
					var listContent = '';
					mui.each(data.result,function(key,value){
						listContent += '<li class=" mui-table-view-cell">'+
								'<a href="/reporting.html?id='+ value.id +'&taskNo='+value.taskNo+'&engineCode='+value.engineCode+'&engineName='+value.engineName+
											'&procCode='+value.procCode+'&procName='+value.procName+'&taskCount='+value.taskCount+'&reportCount='+value.reportCount+'">'+
								'<div><span style="font-size: 30px;margin-top:100px;font-weight: bold;">'+value.taskNo+'</span><br/>' +
									'<div class="mui-row">' +
										'<div class="mui-col-sm-6 mui-col-xs-6" style="text-align: center">' +
											'<span style="font-size: 15px;font-weight: bold;">项目代码:</span>' +
											'<span style="font-size: 13px;">'+value.engineCode+'</span>' +
										'</div>' +
										'<div class="mui-col-sm-6 mui-col-xs-6" style="text-align: center">' +
											'<span style="font-size: 15px;font-weight: bold;">项目名称:</span>' +
											'<span style="font-size: 13px;">'+value.engineName+'</span>' +
										'</div>' +
										'<div class="mui-col-sm-4 mui-col-xs-4" style="text-align: center">' +
											'<span style="font-size: 18px;font-weight: bold;">'+value.procName+'</span>' +
											'<span style="font-size: 13px;">'+value.procCode+'</span>' +
										'</div>' +
										'<div class="mui-col-sm-4 mui-col-xs-4" style="text-align: center">' +
											'<span style="font-size: 15px;">构件数量:</span>' +
											'<span style="font-size: 13px;">'+value.taskCount+'</span>' +
										'</div>' +
										'<div class="mui-col-sm-4 mui-col-xs-4" style="text-align: center">' +
											'<span style="font-size: 15px;">已报数量:</span>' +
											'<span style="font-size: 13px;">'+value.reportCount+'</span>' +
										'</div>' +
									'</div>' +
								'</div>'+
								'</a>'+
								'</li>';
					});
					$("#myList").html(listContent);
				},
				error:function(xhr,type,errorThrown){
					alert("errorThrown");
				}
			})
		});
		function reporting(id,taskNo,engineCode,engineName,procCode,procName,taskCount,reportCount) {
			mui.openWindow({
				url:'reporting.html',
				id:'reporting.html',
				extras:{'taskId':id,'taskNo':taskNo,'engineCode':engineCode,'engineName':engineName,'procCode':procCode,'procName':procName,'taskCount':taskCount,'reportCount':reportCount}
			});
		}
	</script>

</html>
